<?php
/**
 * validatePHP_data_msg
 *
 * @author tuadmin
 * @copyright 2011
 * @version $Id$
 * @access private
 */
class validatePHP_data_msg
{
	private $lang = 'es';
	private static $lang_loaded = array();
	const LANG_ESPANISH = 'es';
	const LANG_ENGLISH = 'en';
	private $self = array();
	public function __construct($lang = 'es')
	{
		if(isset(self::$lang_loaded[$lang]))
		{
			$this->self = & self::$lang_loaded[$lang];
		}
		else
		{
			self::$lang_loaded[$lang] = parse_ini_file(dirname(__FILE__).'/'.$lang.'.lang.ini',false);
			$this->self = & self::$lang_loaded[$lang];
		}
	}
	public static function eraseLangLoaded()
	{
		self::$lang_loaded = array();
	}
	public function length($min,$max)
	{
		return sprintf($this->self["length"],$min,$max);
	}
	public function notEmpty()
	{
		return $this->self["notEmpty"];
	}
	public function equal($external)
	{
		return sprintf($this->self["equal"],$external);
	}
	public function regExp($expresion)
	{
		return sprintf($this->self["regExp"],$expresion);
	}
	public function email()
	{
		return $this->self["email"];
	}
	public function numeric($numero)
	{
		return sprintf($this->self["numeric"],$numero);
	}

}